<?php require_once('Connections/online.php'); ?>
<?php
include("conexion.php");
if (isset($_POST['nombre'])) mysql_query("INSERT INTO categoria (nombre) VALUES ('".$_POST['nombre']."')") or die(mysql_error()); ?> 
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
	<title>Categoria</title>
    <link rel="stylesheet" href="jquery.ui.all.css">
<link rel="stylesheet" href="demos.css">
<link rel="stylesheet" href="jquery.ui.datepicker.css">
<link rel="stylesheet" href="css/jquery-ui-1.8.20.custom.css">
<script src="js/jquery-1.7.2.min.js"></script>
<script src="js/jquery-ui-1.8.20.custom.min.js"></script>
<script src="ui/jquery.ui.core.js"></script>
	<script src="ui/jquery.ui.widget.js"></script>
	<script src="ui/jquery.ui.datepicker.js"></script>
	<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<script>
	$(function() {
		$( "#calendario" ).datepicker();
	});
	</script>
	<link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
    <style type="text/css">
<!--
.Estilo1 {color: #000080}
.Estilo2 {
	font-size: 36px;
	font-weight: bold;
	font-family: Geneva, Arial, Helvetica, sans-serif;
}
-->
    </style>
    <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- Header -->
<div id="header">
	<div class="shell">
		<!-- Logo + Top Nav -->
		<div id="top">
			<h1><a href="#">	<span class="Estilo2">Veterinaria</span> Peluvets</a></h1>
            <div id="top-navigation">
				 <a href="login.php"><strong>Cerrar</strong></a><br><br>
				 <a href="moduloA.php"><strong>Volver</strong></a>
				
			</div>
		</div>
		<!-- End Logo + Top Nav -->
		
		<!-- Main Nav -->
		<div id="navigation">
		<ul id="nav">
			    <li><a href="categorias.php" class="active"><span>Categorias</span></a>
                 <ul id="navi">
          
      </ul>
	            <li><a href="usuarios.php"><span>Usuarios</span></a></li>
				 <li><a href="productos.php"><span>Productos</span></a></li>
				
			</ul>
		</div>
		<!-- End Main Nav -->
	</div>
</div>
<!-- End Header -->

<!-- Container -->
<div id="container">
	<div class="shell">
		
		<!-- Small Nav -->
		<div class="small-nav"></div>
		<!-- End Small Nav -->
		
		<!-- Message OK -->
	  <!-- End Message OK -->		
		
	  <!-- Message Error -->
	  <!-- End Message Error -->
  <br />
		<!-- Main -->
		<div id="main">
        
        
        
        
			<div class="cl"></div>
			
			<!-- Content -->
			<div id="manten">
				
				<!-- Box -->
				<div class="box">
					<!-- Box Head -->
					<div class="box-head"> 
						<h2 class="left">Registro de Categoria&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </h2>
<div class="right">
<a href="modificar_categorias.php"><input type="submit" class="button" value="Modificaciones" /></a>
                            
						</div>
					</div>
					<!-- End Box Head -->	
                     
                     
                     <?php
   $result=mysql_query("SELECT * FROM categoria ORDER BY id_categoria ASC;"); 
?>
                     <div class="table">
                     <table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
							  <th width="178"><div align="left">Codigo</div></th>
							  <th width="164"><div align="left">Categoria</div></th>
                               <th width="104" class="ac"><div align="left">Eliminar</div></th>
				   </tr>
                           <?
   while($row = mysql_fetch_array($result)) { 
      print("<tr><td>".$row['id_categoria']."</td>
	              <td>".$row['nombre']."</td>
				  <td><a href='categorias.php?id_categoria=".$row['id_categoria']."' class='ico del'>Eliminar</a></td></tr>");
				  
   } 
   mysql_free_result($result);
   $id_categoria=$_GET['id_categoria']; 
   mysql_query("delete from categoria where id_categoria = $id_categoria");
    
?> 
    </table>  
    
    </div>    
						<!-- Pagging -->
						
				</div>
	  </div>
	</div>
</div>
<div id="fin">
	<div class="shell">
 
                     
     
    
    
    <div id="sidebar">
				
				<!-- Box -->
				<div class="box">
					
					<!-- Box Head -->
					<!-- End Box Head-->
					
					<div class="box-content">
    
    <div class="table">
    <form id="insertar" name="insertar" method="POST" action="<?php echo $editFormAction; ?>">
        <table width="307">
        <tr><th colspan="2"><span class="Estilo1"><h3 align="center">Insertar Registro</h3></span></th>
       </tr>
        <tr>
        <td  ><span class="Estilo1">Categoria</span></td>
        <td width="209">
          <input name="nombre" type="text" class="field size" id="nombre" placeholder="Ingrese Categoria">
         </span>          </input></td>
        </tr>
        <tr>
        <td></td>
        <td> <input type="submit" name="Submit" class="button" value="Insertar Registro" />
        </td>
        </tr>
        </table>  
        <input type="hidden" name="MM_insert" value="insertar">
    </form>
	</div>
</div>
	
                    <script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
//-->
                    </script>
</body>
</html>